<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>县城小超市ERP系统 - PC版</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        :root {
            --primary-color: #1890ff;
            --secondary-color: #f0f2f5;
            --text-color: #333;
            --light-text: #666;
            --border-color: #e8e8e8;
        }

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
            font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
        }

        body {
            background-color: #f5f7fa;
            color: var(--text-color);
            min-height: 100vh;
            display: flex;
        }

        /* 侧边栏导航 */
        .sidebar {
            width: 220px;
            background-color: white;
            box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
            display: flex;
            flex-direction: column;
            height: 100vh;
            position: fixed;
        }

        .logo {
            padding: 20px;
            font-size: 20px;
            font-weight: bold;
            color: var(--primary-color);
            border-bottom: 1px solid var(--border-color);
            text-align: center;
        }

        .nav-menu {
            flex: 1;
            overflow-y: auto;
            padding: 15px 0;
        }

        .nav-item {
            padding: 12px 20px;
            display: flex;
            align-items: center;
            cursor: pointer;
            transition: all 0.2s;
        }

        .nav-item:hover {
            background-color: var(--secondary-color);
        }

        .nav-item.active {
            background-color: rgba(24, 144, 255, 0.1);
            border-left: 3px solid var(--primary-color);
        }

        .nav-item i {
            width: 24px;
            margin-right: 10px;
            text-align: center;
            color: var(--light-text);
        }

        .nav-item.active i {
            color: var(--primary-color);
        }

        .nav-item span {
            font-size: 14px;
        }

        .nav-item.active span {
            color: var(--primary-color);
            font-weight: 500;
        }

        .user-info {
            padding: 15px 20px;
            border-top: 1px solid var(--border-color);
            display: flex;
            align-items: center;
        }

        .user-avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background-color: var(--secondary-color);
            display: flex;
            align-items: center;
            justify-content: center;
            margin-right: 10px;
            color: var(--primary-color);
        }

        .user-name {
            font-size: 14px;
            flex: 1;
        }

        .user-settings {
            color: var(--light-text);
            cursor: pointer;
        }

        /* 主内容区 */
        .main-content {
            flex: 1;
            margin-left: 220px;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
        }

        .top-bar {
            height: 60px;
            background-color: white;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
            display: flex;
            align-items: center;
            padding: 0 20px;
            justify-content: space-between;
        }

        .search-bar {
            display: flex;
            align-items: center;
            background-color: var(--secondary-color);
            border-radius: 4px;
            padding: 8px 12px;
            width: 300px;
        }

        .search-bar i {
            color: var(--light-text);
            margin-right: 8px;
        }

        .search-bar input {
            border: none;
            background: transparent;
            outline: none;
            flex: 1;
            font-size: 14px;
        }

        .quick-actions {
            display: flex;
            gap: 10px;
        }

        .quick-action {
            padding: 8px 15px;
            background-color: var(--primary-color);
            color: white;
            border-radius: 4px;
            font-size: 14px;
            cursor: pointer;
            display: flex;
            align-items: center;
        }

        .quick-action i {
            margin-right: 5px;
        }

        .quick-action.secondary {
            background-color: white;
            color: var(--primary-color);
            border: 1px solid var(--primary-color);
        }

        /* 仪表盘内容 */
        .dashboard {
            flex: 1;
            padding: 20px;
            display: flex;
            flex-direction: column;
        }

        .stats-cards {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 20px;
            margin-bottom: 20px;
        }

        .stat-card {
            background-color: white;
            border-radius: 8px;
            padding: 20px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        }

        .stat-card .title {
            font-size: 14px;
            color: var(--light-text);
            margin-bottom: 10px;
        }

        .stat-card .value {
            font-size: 24px;
            font-weight: 600;
            margin-bottom: 5px;
        }

        .stat-card .trend {
            font-size: 12px;
            color: #52c41a;
            display: flex;
            align-items: center;
        }

        .stat-card .trend.down {
            color: #f5222d;
        }

        .stat-card .trend i {
            margin-right: 3px;
        }

        .main-content-area {
            display: grid;
            grid-template-columns: 2fr 1fr;
            gap: 20px;
            flex: 1;
        }

        .chart-card {
            background-color: white;
            border-radius: 8px;
            padding: 20px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        }

        .chart-card .header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
        }

        .chart-card .title {
            font-size: 16px;
            font-weight: 500;
        }

        .chart-card .actions {
            display: flex;
            gap: 10px;
        }

        .chart-card .action-btn {
            padding: 4px 8px;
            font-size: 12px;
            border-radius: 4px;
            background-color: var(--secondary-color);
            color: var(--light-text);
            cursor: pointer;
        }

        .chart-card .action-btn.active {
            background-color: var(--primary-color);
            color: white;
        }

        .recent-transactions {
            background-color: white;
            border-radius: 8px;
            padding: 20px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        }

        .transactions-list {
            margin-top: 15px;
        }

        .transaction-item {
            display: flex;
            justify-content: space-between;
            padding: 12px 0;
            border-bottom: 1px solid var(--border-color);
        }

        .transaction-item:last-child {
            border-bottom: none;
        }

        .transaction-info .id {
            font-size: 12px;
            color: var(--light-text);
            margin-bottom: 3px;
        }

        .transaction-info .items {
            font-size: 14px;
        }

        .transaction-amount {
            text-align: right;
        }

        .transaction-amount .total {
            font-weight: 500;
            margin-bottom: 3px;
        }

        .transaction-amount .profit {
            font-size: 12px;
            color: #52c41a;
        }

        .view-all {
            text-align: center;
            margin-top: 15px;
        }

        .view-all a {
            color: var(--primary-color);
            font-size: 14px;
            text-decoration: none;
        }
    </style>
</head>
<body>
<!-- 侧边栏导航 -->
<div class="sidebar">
    <div class="logo">小超市ERP</div>

    <div class="nav-menu">
        <div class="nav-item active">
            <i class="fas fa-home"></i>
            <span>仪表盘</span>
        </div>
        <div class="nav-item">
            <i class="fas fa-barcode"></i>
            <span>快速入库</span>
        </div>
        <div class="nav-item">
            <i class="fas fa-cash-register"></i>
            <span>销售收银</span>
        </div>
        <div class="nav-item">
            <i class="fas fa-chart-line"></i>
            <span>利润分析</span>
        </div>
        <div class="nav-item">
            <i class="fas fa-boxes"></i>
            <span>库存管理</span>
        </div>
        <div class="nav-item">
            <i class="fas fa-box-open"></i>
            <span>商品管理</span>
        </div>
        <div class="nav-item">
            <i class="fas fa-truck"></i>
            <span>供应商</span>
        </div>
        <div class="nav-item">
            <i class="fas fa-bell"></i>
            <span>库存预警</span>
        </div>
        <div class="nav-item">
            <i class="fas fa-cog"></i>
            <span>系统设置</span>
        </div>
    </div>

    <div class="user-info">
        <div class="user-avatar">
            <i class="fas fa-user"></i>
        </div>
        <div class="user-name">王老板</div>
        <div class="user-settings">
            <i class="fas fa-ellipsis-v"></i>
        </div>
    </div>
</div>

<!-- 主内容区 -->
<div class="main-content">
    <!-- 顶部操作栏 -->
    <div class="top-bar">
        <div class="search-bar">
            <i class="fas fa-search"></i>
            <input type="text" placeholder="搜索商品、订单或功能...">
        </div>

        <div class="quick-actions">
            <div class="quick-action secondary">
                <i class="fas fa-question-circle"></i>
                <span>帮助中心</span>
            </div>
            <div class="quick-action">
                <i class="fas fa-plus"></i>
                <span>快速入库</span>
            </div>
        </div>
    </div>

    <!-- 仪表盘内容 -->
    <div class="dashboard">
        <!-- 统计卡片 -->
        <div class="stats-cards">
            <div class="stat-card">
                <div class="title">今日销售额</div>
                <div class="value">¥1,258.00</div>
                <div class="trend">
                    <i class="fas fa-arrow-up"></i>
                    12% 较昨日
                </div>
            </div>
            <div class="stat-card">
                <div class="title">今日利润</div>
                <div class="value">¥386.50</div>
                <div class="trend">
                    <i class="fas fa-arrow-up"></i>
                    8% 较昨日
                </div>
            </div>
            <div class="stat-card">
                <div class="title">今日交易</div>
                <div class="value">32笔</div>
                <div class="trend down">
                    <i class="fas fa-arrow-down"></i>
                    5% 较昨日
                </div>
            </div>
            <div class="stat-card">
                <div class="title">库存预警</div>
                <div class="value">8种</div>
                <div class="trend">
                    <i class="fas fa-exclamation-triangle"></i>
                    需及时补货
                </div>
            </div>
        </div>

        <!-- 主要内容区 -->
        <div class="main-content-area">
            <!-- 销售趋势图 -->
            <div class="chart-card">
                <div class="header">
                    <div class="title">近7天销售趋势</div>
                    <div class="actions">
                        <div class="action-btn active">7天</div>
                        <div class="action-btn">30天</div>
                        <div class="action-btn">自定义</div>
                    </div>
                </div>
                <div class="chart-placeholder" style="height: 300px; background-color: #f5f7fa; display: flex; align-items: center; justify-content: center; color: var(--light-text);">
                    [此处为销售趋势图表]
                </div>
            </div>

            <!-- 最近交易 -->
            <div class="recent-transactions">
                <div class="header">
                    <div class="title">最近交易记录</div>
                    <div class="actions">
                        <div class="action-btn">查看全部</div>
                    </div>
                </div>

                <div class="transactions-list">
                    <div class="transaction-item">
                        <div class="transaction-info">
                            <div class="id">订单 #20230722015</div>
                            <div class="items">可乐×2, 薯片×1, 啤酒×6</div>
                        </div>
                        <div class="transaction-amount">
                            <div class="total">¥86.50</div>
                            <div class="profit">利润 ¥28.70</div>
                        </div>
                    </div>
                    <div class="transaction-item">
                        <div class="transaction-info">
                            <div class="id">订单 #20230722014</div>
                            <div class="items">香烟×1, 打火机×1</div>
                        </div>
                        <div class="transaction-amount">
                            <div class="total">¥45.00</div>
                            <div class="profit">利润 ¥12.50</div>
                        </div>
                    </div>
                    <div class="transaction-item">
                        <div class="transaction-info">
                            <div class="id">订单 #20230722013</div>
                            <div class="items">大米×1袋, 食用油×1桶</div>
                        </div>
                        <div class="transaction-amount">
                            <div class="total">¥128.00</div>
                            <div class="profit">利润 ¥38.40</div>
                        </div>
                    </div>
                    <div class="transaction-item">
                        <div class="transaction-info">
                            <div class="id">订单 #20230722012</div>
                            <div class="items">矿泉水×12瓶, 面包×3</div>
                        </div>
                        <div class="transaction-amount">
                            <div class="total">¥56.00</div>
                            <div class="profit">利润 ¥18.20</div>
                        </div>
                    </div>
                </div>

                <div class="view-all">
                    <a href="sales.html">查看全部交易记录 <i class="fas fa-arrow-right"></i></a>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    // 导航菜单切换
    document.querySelectorAll('.nav-item').forEach(item => {
        item.addEventListener('click', function() {
            document.querySelectorAll('.nav-item').forEach(nav => {
                nav.classList.remove('active');
            });
            this.classList.add('active');

            // 这里可以添加页面切换逻辑
            console.log('切换到: ' + this.querySelector('span').textContent);
        });
    });

    // 时间范围切换
    document.querySelectorAll('.chart-card .action-btn').forEach(btn => {
        btn.addEventListener('click', function() {
            this.parentNode.querySelectorAll('.action-btn').forEach(b => {
                b.classList.remove('active');
            });
            this.classList.add('active');

            // 这里可以添加图表数据更新逻辑
            console.log('切换时间范围: ' + this.textContent);
        });
    });

    // 快速入库按钮
    document.querySelector('.quick-action').addEventListener('click', function() {
        console.log('打开快速入库界面');
        // 实际应用中这里会跳转到入库页面或打开入库模态框
    });

    // 搜索功能
    const searchInput = document.querySelector('.search-bar input');
    searchInput.addEventListener('keypress', function(e) {
        if (e.key === 'Enter') {
            console.log('搜索: ' + this.value);
            // 实际应用中这里会执行搜索操作
        }
    });
</script>
</body>
</html>